<html>

<head>
</head>

<body>
  <div>
  </div>
</body>
<script>
  let js = '2020-11-19 09:18:00'
  let num = 60000 // 1分钟
  console.log(jsDate(js, num));

  function jsDate(date, num){
    if(!date || !num){ return false }
    let oldTime = (new Date(date)).getTime(); //得到毫秒数
    let newTime = new Date().getTime();
    if(oldTime > newTime){
      if((oldTime - num) > newTime){ return false } 
      else { return true }
    } else {
      if((newTime - num) > oldTime){ return false } 
      else { return true }
    }
  }

</script>

</html>